<?php
abstract class My_DTO
{
    public function __construct($options = null)
    {
        if (is_array($options)) {
            $this->fromArray($options);
        }
    }

	public function fromArray(array $options)
	{
		foreach ($options as $key => $value) {
			if(property_exists($this,$key)){
				$this->$key = $value;
			}
		}
		return $this;
	}

	public function toArray()
	{
		foreach ($this as $key => $value)
		{
			$array[$key] = $value;
		}
		return $array;
	}

	
	
}